Skip to content

fix(test): use own class to load yaml in BuiltInResourceCleanerIT - #3742

Merged
csviri merged 1 commit into
operator-framework:mainfrom
matheusandre1:issue2484
Dec 3, 2026
Merged

csviri merged 1 commit into
operator-framework:mainfrom
matheusandre1:issue2484

Conversation

@matheusandre1

@matheusandre1 matheusandre1 commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

Fixes: #2484

Summary by CodeRabbit

  • Tests
    • Corrected the test’s service template loading context; the template path and label assignment remain unchanged.

Signed-off-by: Matheus André <matheusandr2@gmail.com>
Copilot AI balanced review requested due to automatic review settings December 3, 2026 15:51
@openshift-ci
openshift-ci Bot requested review from csviri and xstefank December 3, 2026 15:51
@coderabbitai

coderabbitai Bot commented Dec 3, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The test now loads the service template relative to BuiltInResourceCleanerIT. The template path and subsequent label assignment are unchanged.

Changes: Service template loading

Layer / File(s) Summary
Update template resource context
operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/builtinresourcecleaner/BuiltInResourceCleanerIT.java
testService() uses BuiltInResourceCleanerIT as the resource context. The unused StandaloneDependentResourceIT import is removed.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Other

Suggested reviewers: csviri, xstefank

Merge Risk: Minimal · up to 80a92

This is a small test-only cleanup that changes which class loads the YAML template and removes an unused import. It does not affect production behavior, and merge risk is minimal.

Pre-merge checks: Passed 4

Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title states the main change: BuiltInResourceCleanerIT now loads its YAML using its own class instead of StandaloneDependentResourceIT. The raw summary confirms this change in testService(), and t…
Linked Issues check Passed Issue #2484 asks to investigate a suspicious class reference in a YAML loader. The reviewed diff changes BuiltInResourceCleanerIT.testService() from `ReconcilerUtilsInternal.loadYaml(Service.class, …
Out of Scope Changes check Passed The whole-PR diff against the merge base touches only BuiltInResourceCleanerIT.java. The changes are the class-context replacement in testService() and the removal of the import that only that rep…
Full details: Title check

Explanation

The title states the main change: BuiltInResourceCleanerIT now loads its YAML using its own class instead of StandaloneDependentResourceIT. The raw summary confirms this change in testService(), and the PR objectives link it to issue #2484. The title uses the fix(test) prefix, which fits a test-only correction.

Full details: Linked Issues check

Explanation

Issue #2484 asks to investigate a suspicious class reference in a YAML loader. The reviewed diff changes BuiltInResourceCleanerIT.testService() from ReconcilerUtilsInternal.loadYaml(Service.class, StandaloneDependentResourceIT.class, ...) to loadYaml(Service.class, getClass(), ...). The class context now refers to the test's own class, not to an unrelated test class. The template path /io/javaoperatorsdk/operator/service-template.yaml and the label assignment are unchanged. The unused StandaloneDependentResourceIT import is removed. The PR does not record separate investigation findings, but the code change addresses the flagged reference. No automated test was added, and none is required by the issue text.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base touches only BuiltInResourceCleanerIT.java. The changes are the class-context replacement in testService() and the removal of the import that only that replacement used. Both changes relate directly to the flagged class reference in #2484. No unrelated changes were found.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4172c591-c9a0-4e7e-8de8-818984193c96
Commits

Reviewing files that changed from the base of the PR and between 8808a8c and 80a92cb.

Files selected for processing: 1

  • operator-framework/src/test/java/io/javaoperatorsdk/operator/baseapi/builtinresourcecleaner/BuiltInResourceCleanerIT.java

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are recorded for the YAML fixture-loading cleanup.

No open issues 🎉

What changed in this PR

Addresses #2484 by making BuiltInResourceCleanerIT use its own class when loading the YAML fixture.

Changes:

  • Replaces StandaloneDependentResourceIT.class with getClass().
  • Removes the unused import.
File Description
operator-framework/​src/​test/​java/​io/​javaoperatorsdk/​operator/​baseapi/​builtinresourcecleaner/​BuiltInResourceCleanerIT.java Removes the YAML loader’s dependency on an unrelated test class.

Review effort: Balanced

@csviri csviri left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@csviri
csviri merged commit 43d925a into operator-framework:main Dec 3, 2026
30 checks passed
@csviri

csviri commented Dec 3, 2026

Copy link
Copy Markdown
Collaborator

thank you @matheusandre1 !

@matheusandre1
matheusandre1 deleted the issue2484 branch December 3, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Investigate suspicious class reference in YAML loader

3 participants